package javase.chixing.thread_synchronized;

class ThreadD extends Thread{
    @Override
    public void run() {
        synchronized (ThreadMainDemo.obj) {
            System.out.println("D线程正在初始化...");
            //开始唤醒 wait C状态
            //notify 随机唤醒一个 wait 状态线程
            //notify 唤醒所有 wait 状态线程
            System.out.println("D线程准备进入唤醒状态...");
            ThreadMainDemo.obj.notify();
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("D线程执行结束...");
        }
    }
}
